package com.ruoyi.project.learn.bookRoom.controller;

import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.learn.redBook.domain.DjRedBook;
import com.ruoyi.project.learn.redBook.service.IDjRedBookService;
import com.ruoyi.project.system.cms.domain.CommonCms;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 红色书籍Controller
 * 
 * @author ruoyi
 * @date 2025-09-17
 */
@Controller
@RequestMapping("/learn/bookRoom")
public class DjBookRoomController extends BaseController
{
    private String prefix = "learn/bookRoom";

    @Autowired
    private IDjRedBookService djRedBookService;

    @GetMapping()
    public String redBook()
    {
        return prefix + "/bookRoom";
    }

    @GetMapping("/view/{id}")
    public String view(@PathVariable("id") Long id, ModelMap mmap)
    {
        DjRedBook djRedBook = djRedBookService.selectDjRedBookById(id);
        mmap.put("djRedBook", djRedBook);
        return prefix + "/view";
    }
}
